home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 25
/
Aminet 25 (1998)(GTI - Schatztruhe)[!][Jun 1998].iso
/
Aminet
/
text
/
misc
/
nroff.lha
/
nroff
/
tests.shar.Z
/
tests.shar
/
nh.ms
< prev
next >
Wrap
Text File
|
1998-03-09
|
3KB
|
103 lines
.\" test the -ms NH macro. execute with: nroff -ms nh.ms
.TL
Test of NH Macro
.LP
Note that we do not need the TL, AU, AI, AB, AE macros to use -ms, just
paragraphs.
We don't even need section headings, though that helps.
Besides, that is what we are testing here!
.\" reset to section 1.
.NH 0
MAJOR SECTION
.LP
This should be section 1.
Always end the section title with a paragraph of some sort.
Here I use left block paragraph, LP.
.LP
It is a major section, in this case.
Note that I started with ".NH 0" here (which resets the left-most level
to "1" but I could have also just started with ".NH 1" indicating level "1"
section.
Also note that NH requires an argument, even if it is just 1 (bug, I am
afraid).
.\" level 1 (default, but MUST specify it!!!)
.NH 1
MAJOR SECTION
.LP
This should be section 2.
Another major section.
.NH 2
Level 2 Section
.LP
This should be section 2.1.
This was specified with ".NH 2" indicating level 2 section.
.NH 2
Another Level 2 Section
.LP
This should be section 2.2.
Also specified with ".NH 2" indicating level 2 section.
.NH 2
Yet Another Level 2 Section
.LP
This should be section 2.3.
Yes, this too was specified with ".NH 2" indicating level 2 section.
.NH 1
BACK TO MAJOR SECTION
.LP
This should be section 3.
It was specified with ".NH 1" indicating back to most major section.
Note that at each NH macro, all higher level section numbers are reset
to zero and the current level is incremented.
.NH 2
Level 2 Section
.LP
This should be section 3.1.
It is a sub section, a so-called level 2 section.
The advantage of just keeping track of the levels is that you can
rapidly add new sections to a text without changing the section numbers
everywhere.
You just pick the correct level and pump in the text.
.NH 2
Another Level 2 Section
.LP
This should be section 3.2.
It is also a sub section, a so-called level 2 section.
.NH 3
Level 3 Section
.LP
This should be section 3.2.1.
Now we go one level deeper in section numbering.
It was specified with ".NH 3" as you would expect.
.NH 3
Another Level 3 Section
.LP
This should be section 3.2.2.
Same level as last section, but increase the count.
.NH 4
Level 4 Section
.LP
This should be section 3.2.2.1.
Yet one more level; this is level 4 (the number of numbers as well).
.NH 4
Another Level 4 Section
.LP
This should be section 3.2.2.2.
.NH 2
Back to Level 2 Section
.LP
This should be section 3.3.
Note we can skip sections going up, but it does not make sense to
skip from level 2 to level 4 while going down, though I guess it is possible.
.NH 3
And Level 3 Section
.LP
This should be section 3.3.1.
One more level down to level 3.
.NH 1
MAJOR SECTION
.LP
This should be section 4.
I am getting tired.
It seems to be working fine.
I am glad i added the ".if" command to nroff, which makes this all possible.